<template>
	<view>
		<w-navbar type="normal"
			background="linear-gradient(60deg, #3d3393 0%, #2b76b9 37%, #2cacd1 65%, #35eb93 100%)">
			<view slot="navbar-center">按钮组件</view>
		</w-navbar>

		<pageDemoBlock title="基本用法" color="#1c87e4">
			<view class="m-b-2">
				<w-button type="primary">默认按钮</w-button>
			</view>
			<view class="m-b-2">
				<w-button type="success">成功按钮</w-button>
			</view>
			<view class="m-b-2">
				<w-button type="info">信息按钮</w-button>
			</view>
			<view class="m-b-2">
				<w-button type="warning">警告按钮</w-button>
			</view>
		</pageDemoBlock>


		<pageDemoBlock title="其他用法" color="#25e417">
			<view class="m-b-2">
				<w-button type="primary" loading>默认按钮+加载</w-button>
			</view>
			<view class="m-b-2">
				<w-button type="success" plain>成功按钮+镂空</w-button>
			</view>
			<view class="m-b-2">
				<w-button type="info" disabled>信息按钮+禁止</w-button>
			</view>
		</pageDemoBlock>

		<pageDemoBlock title="开放能力" color="#ae09e4">
			<view class="m-b-2">
				<w-button type="primary"  openType="feedback">打开“意见反馈”页面</w-button>
			</view>
			<view class="m-b-2">
				<w-button type="primary"  openType="share">触发用户转发</w-button>
			</view>
			<view class="m-b-2">
				<w-button type="primary" @click="getUserInfo">获取用户信息</w-button>
			</view>
			<view class="m-b-2">
				<w-button type="primary"  openType="contact">打开客服会话</w-button>
			</view>
			<view class="m-b-2">
				<w-button type="primary"  openType="getPhoneNumber">获取用户手机号</w-button>
			</view>
			<view class="m-b-2">
				<w-button type="primary"  openType="launchApp">小程序中打开APP</w-button>
			</view>
			<view class="m-b-2">
				<w-button type="primary"  openType="openSetting">打开授权设置页</w-button>
			</view>
		</pageDemoBlock>

	</view>
</template>

<script>
	import pageDemoBlock from '@/components/page-demo-block'
	export default {
		components: {
			pageDemoBlock
		},
		methods:{
			getUserInfo(){
				uni.getUserProfile({
					desc:'UNI-WUI展示需要',
					lang:'zh_CN',
					success:(res)=>{
						console.log(res)
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>
